package com.example.day05;

public class StringVsStringBuffer {

    private static final String ALPHABET = "abcdefghij"; // 10

    public static void main(String[] args) {
//        String s = "";

        StringBuffer s = new StringBuffer();  // StringBuilder
        long start = System.currentTimeMillis(); // 时间毫秒数
        for (int i = 0; i < 100000; i++) {
            s.append(ALPHABET);
        }
        long end = System.currentTimeMillis();

        System.out.println(s.length()); // s.length() = ?
        System.out.println((end - start) / 1000 + " seconds."); // 70 seconds.
    }
}